<?php
/**
 *  💡 免责声明：本软件不得用于商业用途，仅做学习交流
 *  ⚠️ 权利声明：本软件由版权人提供产品技术支持
 *  📅 项目编号：NX2025-0135
 */
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGroupOrderProductsTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('group_order_products', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('名称');
            $table->decimal('price', 10, 2)->comment('价格');
            $table->integer('stock')->default(0)->comment('库存'); // 库存
            $table->text('description')->nullable()->comment('描述');
            $table->string('image')->nullable()->comment('图片');
            $table->timestamps();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `group_order_products` comment '拼单商品表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('group_order_products');
    }
}
